package com.china08.yxyapi.repository.db;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;

import com.china08.yxyapi.entity.db.lessons.YxyLessonsSynchroLessonChapter;

public interface YxyLessonsSynchroLessonChapterRepository
        extends JpaRepository<YxyLessonsSynchroLessonChapter, String> {

    List<YxyLessonsSynchroLessonChapter> findByLessonId(String lessonId);

    YxyLessonsSynchroLessonChapter findTop1ByLessonIdAndOrderNumLessThanOrderByOrderNumDesc(String chapterId,
            Integer orderNum);

    Integer countByLessonIdAndIdIn(String lessonId, List<String> chapterIds);

    Integer countByLessonId(String lessonId);

    List<YxyLessonsSynchroLessonChapter> findByLessonIdAndOrderNumGreaterThan(String lessonId, Integer orderNum);

    YxyLessonsSynchroLessonChapter findById(String chapterId);

    List<YxyLessonsSynchroLessonChapter> findByLessonIdOrderByOrderNumAsc(String lessonId);
}
